
#pragma once

#include <vector>
#include "CFDBC.h"

class ArbitraryQuadrature;

class PeriodicBC : public CFDBC
{
public:
	PeriodicBC(const InputParameters & params);
	virtual ~PeriodicBC(){}

protected:
	virtual void boundaryCondition();
	virtual Real computeQpJacobian(unsigned int p, unsigned int q);
	virtual void precalculateJacobian();
	void reinitFixBC();
	Point periodicPoint(const Point &p);

	const NumericVector<Real> & _serialized_solution;
	const DofMap& _dof_map;
	std::vector<dof_id_type>  _dof_indices;

	int _dim;
	FEType _fe_type;
	FEBase *_fe;
	ArbitraryQuadrature * _qrule_arbitrary;
	const std::vector<std::vector<Real> >& _phi_periodic;
	RealVectorValue _translate[3];
};

template<>
InputParameters validParams<PeriodicBC>();
